home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Musik / Misc / Amster / Source / include / share.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-01  |  2.6 KB  |  103 lines

  1. /*
  2. ** File sharing header
  3. */
  4.  
  5. #include <sys/types.h>
  6.  
  7. #include "include/mui.h"
  8.  
  9. #ifndef AMSTER_SHARE_H
  10. #define AMSTER_SHARE_H
  11.  
  12.  
  13. /* Events */
  14.  
  15. #define SHARE_OPEN      0x7001
  16. #define SHARE_CLOSE     0x7002
  17. #define SHARE_ADD       0x7003
  18. #define SHARE_ADDDIR    0x7004
  19. #define SHARE_REMOVE    0x7005
  20. #define SHARE_LOAD      0x7006
  21. #define SHARE_LOADAS    0x7007
  22. #define SHARE_SAVE      0x7008
  23. #define SHARE_SAVEAS    0x7009
  24. #define SHARE_UPLOAD    0x7010
  25. #define SHARE_NOTIFYALL 0x7011
  26. #define SHARE_PLAY      0x7012
  27. #define SHARE_ADDFILE   0x7013
  28. #define SHARE_ADDFILEN  0x7014
  29. #define SHARE_SETDIR    0x7015
  30. #define SHARE_UPDCOUNT  0x7016
  31.  
  32.  
  33. /* Argument array for parsing sharing file */
  34.  
  35. #define ARG_PATH     0
  36. #define ARG_MD5      1
  37. #define ARG_SIZE     2
  38. #define ARG_BITRATE  3
  39. #define ARG_FREQ     4
  40. #define ARG_TIME     5
  41. #define ARG_REQCOUNT 6
  42.  
  43. extern BOOL sharechanged;
  44.  
  45. typedef struct sharedata_struct {
  46.     char title[256];
  47.     char md5[33];
  48.     unsigned long size;
  49.     int bitrate, freq, time;
  50.     int reqcount;
  51. } *sharedata, _sharedata;
  52.  
  53.  
  54. /* GUI elements */
  55.  
  56. struct shdata {
  57.     u_long *list, *stat;
  58. };
  59.  
  60.  
  61. /* Prototypes */
  62.  
  63. MUIF share_dispatch(REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg);
  64. ULONG share_new(struct IClass *cl, Object *obj, struct opSet *msg);
  65. MUIF sharelistdest(REG(a2) APTR pool, REG(a1) sharedata sd);
  66. MUIF sharelistdisp(REG(a2) char **array, REG(a1) sharedata sd);
  67. MUIF sharelistcomp(REG(a0) struct Hook *hook, REG(a2) Object *obj, REG(a1) struct NList_CompareMessage *ncm);
  68. MUIF ShareListAppMsgFunc(REG(a2) APTR obj, REG(a1) struct AppMessage **x);
  69.  
  70. /* Private */
  71.  
  72. void add_filename(struct shdata *data, char *fname);
  73. void add_file(struct shdata *data, song sdl, char *fname);
  74. void add_shares(struct shdata *data);
  75. void add_directory(struct shdata *data);
  76. void add_recursive(struct shdata *data, sharedata sd, BPTR dirlock, const char *dirname);
  77. void add_shareinfo(struct shdata *data, sharedata sd, BPTR lock);
  78. void notify_shares(struct shdata *data);
  79. void remove_shares(struct shdata *data, long t);
  80. void save_shares(struct shdata *data);
  81. void save_shares_as(struct shdata *data);
  82. void load_shares(struct shdata *data);
  83. void load_shares_as(struct shdata *data);
  84. void update_stat(struct shdata *data);
  85. void play_share(struct shdata *data);
  86.  
  87. void upload_req(char *user, char *fname);
  88. void upload_file_confirm(struct shdata *data, char *user, char *fname);
  89.  
  90. void update_count(struct shdata *data, char *fname);
  91.  
  92. void nap_notifyshare(sharedata sd);
  93.  
  94. BOOL IsIn(char *string, char c);
  95.  
  96. /* Public prototypes */
  97.  
  98. extern char *strrep(char *str1, char *old_str, char *new_str);
  99. extern char *MakeWinPath(char *AmigaPath);
  100.  
  101.  
  102. #endif  /* AMSTER_SHARE_H */
  103.